void main() {
  Person p = Person(name: '张三', age: 20, gender: '男', address: '北京');
  p.say();
}

class Person {
  String? name;
  int? age;
  String? gender;
  String? address;

  //简单写法
  // Person({this.name, this.age, this.gender, this.address});
  Person({String? name, int? age, String? gender, String? address}) {
    this.name = name;
    this.age = age;
    this.gender = gender;
    this.address = address;
  }
  say() {
    print('我叫$name,我今年$age岁,我是一个$gender,我住在$address');
  }
}
